Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Sametime Forum

HCL Sametime Forum


  

PreviousPrevious NextNext

RE: Can a sametime bot be implemented as a servlet
~Samuel Desponemanli 30.Jan.07 11:30 PM a Web browser
General All Releases Linux


Got the servlet working , but I am still unable to figure out what I should modify in the servlet to make it a bot . I have moved the code from main to init method of the servlet .

What else needs to chnage in servlet code

my Init method looks like this

public void init(ServletConfig config)
throws ServletException
{
super.init(config);


// Redirect STD output and STD error
// Set Sametime debug level
try {
PrintStream ps;
ps = new PrintStream(
new FileOutputStream("/dataserver/logs/ST-log.txt"));
System.setOut(ps);
System.setErr(ps);
Debug.m_debugLevel = 5;
}
catch (FileNotFoundException e) {
}


// Init Sametime
log("initialize sametime");
initSametime();


// Wait until initialization complete
try
{
synchronized(this)
{
wait();
}
}
catch (InterruptedException e)
{
}

log(">> Sametime servlet was initialized successfully");
}

/**
* Initialize Sametime and save references to Sametime Services
**/
void initSametime()
{
// Create the session, load components and start it
try
{
m_session = new STSession("" + this );
loadComponents();

m_session.loadSemanticComponents();

m_session.start();
}
catch (DuplicateObjectException e)
{
e.printStackTrace();
}


// Save references for later use
LookupService lookup = (LookupService)m_session.getCompApi(LookupService.COMP_NAME);
m_resolver = lookup.createResolver(true, true, true, true);
m_resolver.addResolveListener(this);

m_session.getCompApi(LookupService.COMP_NAME);
m_saService = (ServerAppService) m_session.getCompApi(ServerAppService.COMP_NAME);
m_storageService = (SAppStorageService) m_session.getCompApi(SAppStorageService.COMP_NAME);
m_tokenService = (SATokenService) m_session.getCompApi(SATokenService.COMP_NAME);
m_tokenService.addTokenServiceListener(this);
m_blService = (BLService) m_session.getCompApi(BLService.COMP_NAME);


commService = (CommunityService)m_session.getCompApi(CommunityService.COMP_NAME);
commService.addLoginListener(this);

// Login to the server
loginToServer("bhst01.verizon.com");

}


void loginToServer(String serverName)
{
m_saService.addLoginListener(this);
short loginType = STUserInstance.LT_USER_JAVA_APP;

Connection[] connections = {
new SocketConnection(1516, 17000), };
m_saService.setConnectivity(connections);

log(">> login to sametime server name is " + serverName);
m_saService.loginAsServerApp( serverName, loginType,"iBPMServlet", null);


log("Bot login ");
commService.loginByPassword(serverName, "dc36wbl", "eg%4rTH0");
log("Bot login ");


}



public void loggedIn(LoginEvent event)
{
log(">> loggedIn to Sametime");
m_storageService.addStorageServiceListener(this);

imService = (InstantMessagingService)m_session.getCompApi(InstantMessagingService.COMP_NAME);
imService.registerImType(ImTypes.IM_TYPE_CHAT);
imService.addImServiceListener(this);
confService = (ConfService)m_session.getCompApi(ConfService.COMP_NAME);
}

the loggedIn method implemented what I have for my java bot code .

When I start my web server , this servlet throws some error code

[30/Jan/2007:17:08:19] info ( 4950): WEB2798: [] ServletContext.log(): iBPMServlet: initialize sametime
[30/Jan/2007:17:08:21] info ( 4950): WEB2798: [] ServletContext.log(): iBPMServlet: >> login to sametime server name is bhst01.verizon.com
[30/Jan/2007:17:08:21] info ( 4950): WEB2798: [] ServletContext.log(): iBPMServlet: >> Sametime servlet was initialized successfully
[30/Jan/2007:17:08:23] info ( 4950): HTTP3072: [LS ls1] http://localhost.localdomain:8000 ready to accept requests
[30/Jan/2007:17:08:23] info ( 4950): CORE3274: successful server startup
[30/Jan/2007:17:08:25] info ( 4985): WEB2798: [] ServletContext.log(): iBPMServlet: ***** loggedOut from Sametime reason = -2147483645
[30/Jan/2007:17:08:25] info ( 4985): WEB2798: [] ServletContext.log(): iBPMServlet: ***** loggedOut from Sametime reason = -2147483645
[30/Jan/2007:17:18:34] info ( 4950): CORE5073: Web server shutdown in progress



Have I missed the bus on this one completely .

Please please help !!!

thanks in advance .. any light on this matter will help


Thanks Alpa




Can a sametime bot be implement... (~Samuel Despone... 26.Jan.07)
. . RE: Can a sametime bot be implement... (~Gus Brenuter 29.Jan.07)
. . . . RE: Can a sametime bot be implement... (~Samuel Despone... 29.Jan.07)
. . . . . . RE: Can a sametime bot be implement... (~Gus Brenuter 30.Jan.07)
. . . . . . . . RE: Can a sametime bot be implement... (~Samuel Despone... 30.Jan.07)
. . . . . . . . RE: Can a sametime bot be implement... (~Samuel Despone... 30.Jan.07)
. . . . . . . . . . RE: Can a sametime bot be implement... (~Gus Brenuter 31.Jan.07)
. . . . . . . . . . . . RE: Can a sametime bot be implement... (~Samuel Despone... 1.Feb.07)
. . . . . . . . . . . . . . RE: Can a sametime bot be implement... (~Vanessa Desvel... 21.Feb.08)


Document Options






  Document options
Print this pagePrint this page

Search this forum

Forum views and search


  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Category
Platform
Release
Advanced search

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS